﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using HigLabo.Net.Extensions;

namespace HigLabo.Net.Twitter
{
    public partial class TwitterClient
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="callback"></param>
        public void GetApplicationRateLimitStatus(Action<RateLimits> callback)
        {
            this.GetApplicationRateLimitStatus(null, callback);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <param name="callback"></param>
        public void GetApplicationRateLimitStatus(GetAppRateLimitStatusCommand command, Action<RateLimits> callback)
        {
            this.GetResultText(TwitterApiUrl.Version1_1.Help.GetRateLimitStatusUrl, command, json => callback(new RateLimits(json)));
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="callback"></param>
        public void GetHelpTos(Action<String> callback)
        {
            this.GetResultText(TwitterApiUrl.Version1_1.Help.GetTosUrl, json => callback(Func.CreateDictionary(json).ToString("tos")));
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="callback"></param>
        public void GetHelpPrivacy(Action<String> callback)
        {
            this.GetResultText(TwitterApiUrl.Version1_1.Help.GetPrivacyUrl, json => callback(Func.CreateDictionary(json).ToString("privacy")));
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="callback"></param>
        public void GetSupportLanguages(Action<LanguageCollection> callback)
        {
            this.GetResultText(TwitterApiUrl.Version1_1.Help.GetLanguagesUrl, json => callback(new LanguageCollection(json)));
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="callback"></param>
        public void GetConfiguration(Action<Configuration> callback)
        {
            this.GetResultText(TwitterApiUrl.Version1_1.Help.GetConfigurationUrl, json => callback(new Configuration(json)));
        }
    }
}
